package com.accp.crm.service;

import java.util.List;

import org.hibernate.SessionFactory;

import com.accp.crm.dao.CommonDAO;
import com.accp.crm.entity.Orders;

public class OrdersService implements IOrdersService {
	
	private CommonDAO<Orders> orderdao;
	
	public void setSessionFactory(SessionFactory sessionFactory){
		orderdao = new CommonDAO<Orders>(sessionFactory,Orders.class);
	}

	@Override
	public List findOrders(String odrCustomer) {
		String hql = "from Orders o where o.odrCustomer=? ";
		List list = this.orderdao.findByHQL(hql, odrCustomer);
		return list;
	}

	@Override
	public Orders findById(Long id) {
		
		return this.orderdao.findById(id);
	}

}
